<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="ERP人事还款流程列表" bodyClass="gray-bg animated fadeInRight" isAnimation="false" libs=["table","zTree","layout-latest"]/>
<div class="container-div">
 <div class="row">
  <div class="col-sm-12 search-collapse">
    <@form.form id="payback-form" class="form-inline">
     <div class="select-list">
      <ul>
           <li>
              <label> <@ctx.i18n text = "流水号"/>：
               <input type="text" name="serialNumber"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "受益人"/>：
               <input type="text" name="applyBeneficiaryUsername"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "输入金额"/>：
               <input type="text" name="applyEnterAmount"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "选择还款方式"/>： </label>
                <select name="applyPaybackMethod" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_erp_paybackmethod')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
              <label> <@ctx.i18n text = "余额"/>：
               <input type="text" name="applyBankBalance"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "付款方式"/>： </label>
                <select name="applyPaymentMethod" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_coll_paymethod')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "审核"/>： </label>
                <select name="approvalReview" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_isOrNo')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
              <label> <@ctx.i18n text = "收到金额"/>：
               <input type="text" name="approvalReceivedAmount"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "收据编号"/>：
               <input type="text" name="approvalReceiptno"/> </label>
            </li>
        <li>
          <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
          <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
       </li>
      </ul>
   </div>
  </@form.form>
 </div>
  <@table id="bootstrap-table">
    <@shiro.hasPermission name="erp:payback:add">
                    <a class="btn btn-success" onclick="opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="erp:payback:edit">
        <a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="erp:payback:del">
        <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">
            <i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>
        </a>
    </@shiro.hasPermission>
   </@table>
  <div>
</div>
<@footer>
<script>
    var editFlag = "${permission.hasPermi("erp:payback:edit")}";
    var listFlag = "${permission.hasPermi("erp:payback:add")}";
    var delFlag = "${permission.hasPermi("erp:payback:del")}";
    var visible = ${permission.isPermitteds("erp:payback:edit,erp:payback:del,erp:payback:add")?string('true', 'false')};
   var applyPaybackMethodDatas = ${dict.getDictListJson('sys_erp_paybackmethod')};
   var applyPaymentMethodDatas = ${dict.getDictListJson('sys_crm_coll_paymethod')};
   var approvalReviewDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var managerApprovalDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
    var prefix = baseURL + "erp/payback";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "ERP人事还款流程",
            uniqueId:    'id'/* 唯一ID */                                                                     ,
            escape: true,            /* 分页设置 */
            showPageGo: true,       /* 分页设置 */
            pageSize: 10,            /* 分页设置 */
            pageList: [10, 30, 50], /* 分页设置 */
            columns: [
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                            return $.table.serialNumber(index);
                }}
                ,{field : 'id',title : '<@ctx.i18n text = "主键"/>',visible: false}
              ,{field : 'serialNumber',title : '<@ctx.i18n text = "流水号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                      ,{field : 'applyBeneficiaryUsername',title : '<@ctx.i18n text = "受益人名称"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'applyEnterAmount',title : '<@ctx.i18n text = "输入金额"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'applyPaybackMethod',title : '<@ctx.i18n text = "选择还款方式"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(applyPaybackMethodDatas, value); }}
              ,{field : 'applyBankBalance',title : '<@ctx.i18n text = "余额"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'applyPaymentMethod',title : '<@ctx.i18n text = "付款方式"/>',formatter: function(value, row, index) {
                   if(value!=null&&value!=''&&value!=undefined){
                       return $.table.selectDictLabel(applyPaymentMethodDatas, value);
                   }
                   else{
                       return '';
                   }
               }}
                   ,{field : 'approvalReview',title : '<@ctx.i18n text = "审核"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalReviewDatas, value); }}
               ,{field : 'approvalReceivedAmount',title : '<@ctx.i18n text = "收到金额"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'approvalReceiptno',title : '<@ctx.i18n text = "收据编号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                   ,{title:"<@ctx.i18n text = '操作'/>",align: 'center',visible:visible,formatter: function(value, row, index) {
                        var actions = [];
                        //   actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="showDetail(\'' + row.id + '\')"><i class="fa fa-remove"></i>查看</a>');
                         return actions.join('');
                    }
                }

                ]
            };
            $.table.init(options);
        });
    function showDetail(id){
        opt.modal.open("查看",prefix+"/view3/"+id);
    }
</script>
</@footer>
</@pageTheme>